From: Bhupinder Thakur Date: Fri, 16 Dec 2016 07:16:27 +0000 (+0530) Subject: xen/arm: Move p2m_vmid_allocator_init() inside setup_virt_paging() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3111 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=3ca8573f8b81b2ff8d14c0fb29260420f868ab7a;p=xen.git xen/arm: Move p2m_vmid_allocator_init() inside setup_virt_paging() Since VMIDs are related to 2nd stage address translation, it makes more sense to move the call to p2m_vmid_allocator_init(), which initializes the vmid allocation bitmap, inside setup_virt_paging(), where 2nd stage address translation is set up. Signed-off-by: Bhupinder Thakur Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 5d5bb872d2..6930f8c70a 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1239,7 +1239,7 @@ static spinlock_t vmid_alloc_lock = SPIN_LOCK_UNLOCKED; */ static DECLARE_BITMAP(vmid_mask, MAX_VMID); -void p2m_vmid_allocator_init(void) +static void p2m_vmid_allocator_init(void) { set_bit(INVALID_VMID, vmid_mask); } @@ -1657,6 +1657,9 @@ void __init setup_virt_paging(void) #endif printk("P2M: %d levels with order-%d root, VTCR 0x%lx\n", 4 - P2M_ROOT_LEVEL, P2M_ROOT_ORDER, val); + + p2m_vmid_allocator_init(); + /* It is not allowed to concatenate a level zero root */ BUG_ON( P2M_ROOT_LEVEL == 0 && P2M_ROOT_ORDER > 0 ); setup_virt_paging_one((void *)val); diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 1678871b5e..049e4491d6 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -781,8 +781,6 @@ void __init start_xen(unsigned long boot_phys_offset, gic_init(); - p2m_vmid_allocator_init(); - softirq_init(); tasklet_subsys_init(); diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index fdb6b47e83..0987be2d36 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -152,9 +152,6 @@ void p2m_altp2m_check(struct vcpu *v, uint16_t idx) /* Not supported on ARM. */ } -/* Initialise vmid allocator */ -void p2m_vmid_allocator_init(void); - /* Second stage paging setup, to be called on all CPUs */ void setup_virt_paging(void);